*Sum input usage across plants
bys ID_FIRM year: egen double cons_input_it = sum(f4_cons_input_it)
bys ID_FIRM year: gen first = year[_n] ~= year[_n+1]
rename defl_inputs n_defl_inputs
rename defl_inputs_2 n_defl_inputs_2
rename defl_inputs_3 n_defl_inputs_3
rename defl_inputs_4 n_defl_inputs_4

keep ID_FIRMA year first cons_input_it n_defl*
rename cons_input_it f4_cons_input_it

keep if first == 1
drop first

